import java.util.Date;

/**
 * Created by asd73 on 2017/8/18.
 */
public class reflect1 {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        Class<?> clazz = new Date().getClass();
        System.out.println(clazz.getName());
        Class<?> cls = Class.forName("java.util.Date");//直接使用字符串描述要使用的类
        Object obj = cls.newInstance();//实例化对象。等价：new java.util.Date()
        System.out.println(obj);
    }
}
